home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume17 / psnup / patch01 next >
Encoding:
Internet Message Format  |  1991-03-09  |  7.6 KB

  1. From: clewis@ferret (Chris Lewis)
  2. Newsgroups: comp.sources.misc
  3. Subject: v17i035:  psnup - N-up Postscript printing, Patch01
  4. Message-ID: <1991Mar9.045938.2578@sparky.IMD.Sterling.COM>
  5. Date: 9 Mar 91 04:59:38 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 4541d9ee a446db3f 4dcf16d9 9ec27120
  8.  
  9. Submitted-by: Chris Lewis <clewis@ferret.ocunix.on.ca>
  10. Posting-number: Volume 17, Issue 35
  11. Archive-name: psnup/patch01
  12. Patch-To: psnup: Volume 16, Issue 104
  13.  
  14. This is the first patch for psnup. Please apply it by changing 
  15. directory to the directory containing the psnup distribution. 
  16. Unshar the patch file and then apply the patch by typing:
  17.     
  18.     patch -N -p < psnup.patch1
  19.  
  20. The psnup program takes arbitrary postscript as input, and wraps it
  21. with additional postscript to implement n-up printing.  The input
  22. postscript is taken from the file arguments, or stdin if no arguments
  23. are specified.  The output is sent to stdout.
  24.  
  25. Chris
  26. --------
  27. #! /bin/sh
  28. # This is a shell archive.  Remove anything before this line, then feed it
  29. # into a shell via "sh file" or similar.  To overwrite existing files,
  30. # type "sh file -c".
  31. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  32. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  33. # If this archive is complete, you will see the following message at the end:
  34. #        "End of shell archive."
  35. # Contents:  psnup.patch1
  36. # Wrapped by kent@sparky on Fri Mar  8 22:45:26 1991
  37. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  38. if test -f 'psnup.patch1' -a "${1}" != "-c" ; then 
  39.   echo shar: Will not clobber existing file \"'psnup.patch1'\"
  40. else
  41. echo shar: Extracting \"'psnup.patch1'\" \(5359 characters\)
  42. sed "s/^X//" >'psnup.patch1' <<'END_OF_FILE'
  43. X*** orig/README    Fri Feb 22 11:03:09 1991
  44. X--- README    Fri Feb 22 11:32:19 1991
  45. X***************
  46. X*** 1,3 ****
  47. X--- 1,38 ----
  48. X+             PSNUP README Patch 1
  49. X+ 
  50. X+             Chris Lewis
  51. X+ 
  52. X+ This release is a combination of two things: a generalized n-up processor
  53. X+ for postscript files, plus a shell wrapper script and manual page.
  54. X+ Ned Batchelder wrote the postscript n-up handling and postscript
  55. X+ compressor program, and I wrote the shell wrapper script and manual page.
  56. X+ I include the original README from Ned Batchelder below.  Note, however,
  57. X+ that the psnup shell script performs the parameter substitution that Ned
  58. X+ refers to.  Therefore, you don't have to do anything to the nup.* stuff.
  59. X+ 
  60. X+ Patch 1 note: I'm more than a little embarrassed about the difficulties
  61. X+ in the shell script and manual page.  That's what comes of not testing
  62. X+ the final version.  In particular, the manual page did not make it clear
  63. X+ that the origin for "-s" is 0 not 1, and the default should be 0 not 1,
  64. X+ and that the -r & -R implementation was reversed.  Hence the fixes to
  65. X+ psnup.sh and psnup.1.  As well, there was a bug in psc.c in that the
  66. X+ return from getchar() was defined as a char, which can cause infinite
  67. X+ loops on some machines.
  68. X+ 
  69. X+ Other changes include this little note in the README (because some people
  70. X+ were editting nup.* directly, which they don't need to) and a removal
  71. X+ of the "%!" from nup.post.ps.
  72. X+ 
  73. X+ Psroff (CAT & ditroff -2- HPLJ/ditroff/Postscript) has been
  74. X+ modified to utilize the nup.epi and nup.pro files.  So, you'll want
  75. X+ to keep this if you intend to use psroff.  Psroff 3.0 will be released
  76. X+ soon.
  77. X+ 
  78. X+ And finally, like all n-up programs, it is possible for it to be fooled.
  79. X+ Nup does what it does by redefining a few operators, such as initgraphics.
  80. X+ Be aware that some applications (tpscript seems to be one of them) will
  81. X+ foul up nup's definitions, and the results will not be what you intended.
  82. X+ -------------------------------------------
  83. X      Nup is designed to be used as a wrap around any PostScript file.
  84. X  Simply prepend nup.pre.ps, and append nup.post.ps, and it should work. There
  85. X  are three tokens in nup.pre.ps which need to be changed before sending it to
  86. X*** orig/nup.post.ps    Fri Feb 22 11:03:13 1991
  87. X--- nup.post.ps    Fri Feb 22 11:07:06 1991
  88. X***************
  89. X*** 1,4 ****
  90. X! %! nup.post.ps -- Postlude for n-up printing. $Revision: 4.2 $
  91. X  %
  92. X  % Ned Batchelder, University of Pennsylvania
  93. X  % ned@UPenn.CSnet
  94. X--- 1,4 ----
  95. X! % nup.post.ps -- Postlude for n-up printing. $Revision: 4.2 $
  96. X  %
  97. X  % Ned Batchelder, University of Pennsylvania
  98. X  % ned@UPenn.CSnet
  99. X*** orig/psc.c    Fri Feb 22 11:03:18 1991
  100. X--- psc.c    Sat Feb 16 22:49:00 1991
  101. X***************
  102. X*** 33,39 ****
  103. X      int    inhex = 0;    /* Are we in a hex string? */
  104. X      int    column = 0;    /* Counts output columns to keep lines short */
  105. X      int    keepch = 0;    /* For breaking strings */
  106. X!     char    c;        /* The current character */
  107. X  
  108. X  # define put(c)        {putchar(c); column++;}
  109. X  
  110. X--- 33,39 ----
  111. X      int    inhex = 0;    /* Are we in a hex string? */
  112. X      int    column = 0;    /* Counts output columns to keep lines short */
  113. X      int    keepch = 0;    /* For breaking strings */
  114. X!     int    c;        /* The current character */
  115. X  
  116. X  # define put(c)        {putchar(c); column++;}
  117. X  
  118. X*** orig/psnup.1    Fri Feb 22 11:03:20 1991
  119. X--- psnup.1    Mon Feb 18 21:38:35 1991
  120. X***************
  121. X*** 42,53 ****
  122. X  The
  123. X  .BI -s n
  124. X  option indicates which spot the first page of output occurs in.
  125. X  .P
  126. X  The defaults are:
  127. X  .BR -p2 ,
  128. X! .BR -r ,
  129. X  and
  130. X! .BR -s1 ,
  131. X  .P
  132. X  .B Psnup
  133. X  tries very hard to retain a trailing control-D if the file has
  134. X--- 42,54 ----
  135. X  The
  136. X  .BI -s n
  137. X  option indicates which spot the first page of output occurs in.
  138. X+ The first spot on the page is 0.
  139. X  .P
  140. X  The defaults are:
  141. X  .BR -p2 ,
  142. X! .BR -R ,
  143. X  and
  144. X! .BR -s0 .
  145. X  .P
  146. X  .B Psnup
  147. X  tries very hard to retain a trailing control-D if the file has
  148. X*** orig/psnup.sh    Fri Feb 22 11:03:21 1991
  149. X--- psnup.sh    Fri Feb 22 11:32:50 1991
  150. X***************
  151. X*** 9,18 ****
  152. X  rm -f /tmp/?$$
  153. X  
  154. X  pages=2
  155. X! #    Default is reversed for use with psroff with psxlate in the
  156. X! #    pipeline to reverse pages.
  157. X! reverse=true
  158. X! start=1
  159. X  
  160. X  for i
  161. X  do
  162. X--- 9,17 ----
  163. X  rm -f /tmp/?$$
  164. X  
  165. X  pages=2
  166. X! #    Default is nonreversed for use with forward printing printers.
  167. X! reverse=false
  168. X! start=0
  169. X  
  170. X  for i
  171. X  do
  172. X***************
  173. X*** 19,29 ****
  174. X      case $i in
  175. X      -p2 | -p4 | -p8 | -p16)
  176. X          pages=`echo $i | sed -e 's/^..//'`
  177. X-         if [ -z "$pages" -o -n "`echo $pages | sed -e 's/[0-9]*//'`" ]
  178. X-         then
  179. X-         echo "$0: Non-numeric pages per sheet option $i" >&2
  180. X-         exit 1
  181. X-         fi
  182. X          ;;
  183. X      -p*)
  184. X          echo "$0: -p option ($i) must be 2, 4, 8 or 16" >&2
  185. X--- 18,23 ----
  186. X***************
  187. X*** 30,39 ****
  188. X          exit 1
  189. X          ;;
  190. X      -r)
  191. X!         reverse=false
  192. X          ;;
  193. X      -R)
  194. X!         reverse=true
  195. X          ;;
  196. X      -s*)
  197. X          start=`echo $i | sed -e 's/^..//'`
  198. X--- 24,33 ----
  199. X          exit 1
  200. X          ;;
  201. X      -r)
  202. X!         reverse=true
  203. X          ;;
  204. X      -R)
  205. X!         reverse=false
  206. X          ;;
  207. X      -s*)
  208. X          start=`echo $i | sed -e 's/^..//'`
  209. X***************
  210. X*** 54,62 ****
  211. X      esac
  212. X      shift
  213. X  done
  214. X! if [ $start -gt $pages ]
  215. X  then
  216. X!     echo "$0: start option (-s$start) must be <= pages/sheet (-p$pages)" \
  217. X      >&2
  218. X      exit 1
  219. X  fi
  220. X--- 48,56 ----
  221. X      esac
  222. X      shift
  223. X  done
  224. X! if [ $start -ge $pages ]
  225. X  then
  226. X!     echo "$0: start option (-s$start) must be < pages/sheet (-p$pages)" \
  227. X      >&2
  228. X      exit 1
  229. X  fi
  230. X
  231. END_OF_FILE
  232. if test 5359 -ne `wc -c <'psnup.patch1'`; then
  233.     echo shar: \"'psnup.patch1'\" unpacked with wrong size!
  234. fi
  235. # end of 'psnup.patch1'
  236. fi
  237. echo shar: End of shell archive.
  238. exit 0
  239. exit 0 # Just in case...
  240. -- 
  241. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  242. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  243. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  244. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  245.